home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 024 / modula-2 / m2 / filesystem.def < prev    next >
Text File  |  1995-03-17  |  2KB  |  46 lines

  1. (********************************************************************************
  2.  
  3. Name         : FileSystem.DEF
  4. Version      : 1.0
  5. Purpose      : FileSystem for Modula-2 compiler
  6. Authors      : cn/jr/ms/red
  7. Modified     : 12.3.86  18:38  cn
  8. State        : should be ok
  9. Requirements : fixkey
  10.  
  11. ********************************************************************************)
  12.  
  13. DEFINITION MODULE FileSystem;
  14.  
  15.   FROM SYSTEM IMPORT WORD;
  16.  
  17.   TYPE
  18.     Response = (done, notdone);
  19.  
  20.     File     = RECORD
  21.                  refNum:     INTEGER;                 (* unused *)
  22.                  fileHandle,                          (* AMIGAFile *)
  23.                  firstPos:   LONGINT;                 (* FilePos of buffer[0] *)
  24.                  lastPos,                             (* HIGH(buffer)=lastPos-1 *)
  25.                  curPos:     INTEGER;                 (* next to read or write *)
  26.                  res:        Response;
  27.                  eof:        BOOLEAN;
  28.                  dirty:      BOOLEAN;                 (* dirty: buffer changed *)
  29.                  nameString: ARRAY [0..31] OF CHAR;
  30.                  buffer:     ARRAY [0..1024-1] OF CHAR;
  31.                END;
  32.  
  33.   PROCEDURE Lookup(VAR f: File; filename: ARRAY OF CHAR; new: BOOLEAN); 
  34.   PROCEDURE Close(VAR f: File);
  35.   PROCEDURE Delete(VAR f: File);
  36. (*PROCEDURE Rename(VAR f: File; filename: ARRAY OF CHAR);*)
  37.   PROCEDURE SetPos(VAR f: File; highpos, lowpos: CARDINAL);
  38.   PROCEDURE GetPos(VAR f: File; VAR highpos, lowpos: CARDINAL);
  39.   PROCEDURE Length(VAR f: File; VAR highpos, lowpos: CARDINAL);
  40.   PROCEDURE ReadWord(VAR f: File; VAR w: WORD);
  41.   PROCEDURE WriteWord(VAR f: File; w: WORD);
  42.   PROCEDURE ReadChar(VAR f: File; VAR ch: CHAR);
  43.   PROCEDURE WriteChar(VAR f: File; ch: CHAR);
  44.  
  45. END FileSystem.
  46.